#ifndef __GlCamera_h__
#define __GlCamera_h__

#include "GlPosition.h"
#include "GlMain.h"

namespace GraphicLibrary
{
	class Matrix4x4;
	class Window;

	class GlExport Camera
	{
		public:
			Position	mPosition;
			float		mDirection;
			float		mPixelMultiplier;
			void lookAt(const Position &target);
			Matrix4x4 getTransformationMatrix() const;
			Position projectScreenSpaceToGameSpace(const float x, const float y) const;
			inline static void Init(const Window *window)
			{
				if(msSingleton)
					delete msSingleton;
				msSingleton = new Camera(window);
			}
			inline static Camera* GetSingleton()	{return msSingleton;}
		private:
			const Window*	mWindow;
			inline Camera(const Window *window)
				: mPosition(0.0f, 0.0f)
				, mDirection(0.0f)
				, mWindow(window)
				, mPixelMultiplier(1.0f)
			{}
			static Camera*	msSingleton;

			Matrix4x4 getInvTransformationMatrix() const;
	};
};

#endif // __GlCamera_h__
